package com.cyj.dream.admin.contacts.enums;


import com.cyj.dream.core.util.IsEmptyUtils;

/**
 * @Description: 用户是否锁定或者删除通用
 * @BelongsProject: dream-DreamChardonnay
 * @BelongsPackage: com.dream.DreamChardonnay.constant.enums
 * @Author: ChenYongJia
 * @CreateTime: 2021-04-13 09:59
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
public enum UserGolEnum {

    /**
     * 用户类型(0:内部用户 1:客户 2:会员)
     * 微信端 性别 0:未知 1:男 2:女
     */
    IS_FALSE(0, "未删除/未锁定"),
    IS_TRUE(1, "已删除/已锁定");

    private Integer code;
    private String message;

    UserGolEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 根据 类型编码 来获取 描述信息
     * @param code
     * @return
     */
    public static String getMessByCode(Integer code) {
        if (IsEmptyUtils.isEmpty(code)) {
            return null;
        }

        for (UserGolEnum UserGolEnum : values()) {
            if (UserGolEnum.getCode().equals(code)) {
                return UserGolEnum.getMessage();
            }
        }
        throw new RuntimeException("没有找到对应的描述信息");
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static void main(String[] args) {
        System.out.println(UserGolEnum.IS_FALSE);
    }

}
